package cn.controller.marketing;

import cn.service.marketingService.MarketingServiceImpl.NewMarketingServiceImpl;
import entity.marketingEntity.NewMarketingCondition;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/30 9:26
 */
@RestController
@CrossOrigin
@RequestMapping("/marketing")
public class NewMarketingController {
    @Autowired
    NewMarketingServiceImpl service;
    @RequestMapping("/getNewMarking")
    public Result getNewMarking(@RequestBody NewMarketingCondition condition){
        return service.getNewMarking(condition);
    }
    @RequestMapping("/updateNewMarkingRecommend")
    public Result updateNewMarkingRecommend(Integer id,Integer recommend){
        return service.updateNewMarkingRecommend(id,recommend);
    }
    @RequestMapping("/updateNewMarkingSort")
    public Result updateNewMarkingSort(Integer id,Integer sort){
        return service.updateNewMarkingSort(id,sort);
    }
    @RequestMapping("/addNewMarketing")
    public Result addNewMarketing(@RequestBody List<String> list){
        return service.addNewMarketing(list);
    }
    @RequestMapping("/deleteNewMarketing")
    public Result deleteNewMarketing(Integer id){
        return service.deleteNewMarketing(id);
    }
}
